package com.yhjr.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yhjr.mapper.Customer_basicMapper;
import com.yhjr.mapper.Customer_caselistMapper;
import com.yhjr.mapper.Customer_creditMapper;
import com.yhjr.mapper.Customer_main_eMapper;
import com.yhjr.mapper.Customer_main_pMapper;
import com.yhjr.mapper.Customer_propertyMapper;
import com.yhjr.mapper.Customer_vehicleMapper;
import com.yhjr.pojo.Customer_basic;
import com.yhjr.pojo.Customer_basicExample;
import com.yhjr.service.inter.Customer_basicService;

/**
 * 用户信息的实现类
 *  @author Administrator
 *  @name  li-shu-jia
 *  @date 2018年1月12日
 *  @update2018年1月12日
 */
@Service
public class Customer_basicServiceImpl implements Customer_basicService {
    
	@Autowired
	private      Customer_basicMapper       customer_basicMapper;
	@Autowired
	private      Customer_caselistMapper    customer_caselistMapper;
	@Autowired 
	private      Customer_main_eMapper      customer_main_eMapper;
	@Autowired
	private      Customer_main_pMapper      customer_main_pMapper;
	@Autowired
	private      Customer_propertyMapper    customer_propertyMapper;
	@Autowired
	private      Customer_creditMapper      customer_creditMapper;
	@Autowired
	private     Customer_vehicleMapper      customer_vehicleMapper;
	
	
	
	/**
	 * 获得所有的物业资料信息
	 */
	public List<Customer_basic> treeGrid() {
		// 获得所有的物业资料信息
		Customer_basicExample   ce=new  Customer_basicExample();
	return  customer_basicMapper.selectByExample(ce);
	}

	
	
	/**
	 * 保存用户信息
	 */
	@Override
	public int save(Customer_basic customer_basic) {
	
		
		
	  		
		return customer_basicMapper.insert(customer_basic);
	}
	
	
	
	/**
	 * 根据ID查询
	 */
	@Override
	public Customer_basic getDataById(int id) {
		return customer_basicMapper.selectByPrimaryKey(id);
	}
	
	/**
	 * 修改用户
	 */
	@Override
	public int update(Customer_basic customer_basic) {
		return customer_basicMapper.updateByPrimaryKey(customer_basic);
	}
	
	
	
	/**
	 * 
	 * 删除用户信息
	 * 
	 */
	@Override
	public int delete(int id) {
		return customer_basicMapper.deleteByPrimaryKey(id);
	}


	/**
	 * 
	 * 根据条件查询数据
	 * 
	 */
	@Override
	public List<Customer_basic> selectByCondition(Customer_basic customer_basic) {
		return customer_basicMapper.selectByCondition(customer_basic);
	}


  //新增用户时显示用户的编号
	@Override
	public String getCustId() {
		// TODO Auto-generated method stub
		customer_basicMapper.getCustId();
		return null;
	}
   

	
}
